<?php

use Fairy\HttpCrontabService;

require_once "vendor/autoload.php";

date_default_timezone_set('PRC');

$dbConfig = [
    'hostname' => '127.0.0.1',
    'hostport' => '3306',
    'username' => 'root',
    'password' => 'root',
    'database' => 'test',
    'charset' => 'utf8mb4'
];

if (file_exists('.env')) {
    $dbConfig = array_merge($dbConfig, array_change_key_case(parse_ini_file('.env')));
}

(new HttpCrontabService())
    ->setSafeKey('Q85gb1ncuWDsZTVoAEvymrNHhaRtp73M')
    ->setDebug()
    ->setName('System Crontab')
    ->setDbConfig($dbConfig)
    ->run();
